﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B303Langf.Parser.AST
{
   public class Block : AST
   {
      public Block()
      {
         Statements = new List<Statement>();
      }

      public List<Statement> Statements
      {
         get;
         private set;
      }

      [TraverseIgnore]
      public List<DeclarationStatement> DeclarationStatements
      {
         get
         {
            return Statements.Where( x => x is DeclarationStatement ).Cast<DeclarationStatement>().ToList();
         }
      }

      public override object Visit( IVisitor v, object obj )
      {
         return v.VisitBlock( this, obj );
      }
   }
}
